<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php $this->load->view('admin/header.html')?>
<script type="text/javascript">
    function Success(data) {
        $.Success(data);
    }
    function edit_banner(url) {
        layer.open({
            type: 2,
            title: 'Banner添加',
            maxmin: true,
            shadeClose: true, //开启点击遮罩关闭层
            area: ['800px', '550px'],
            offset: ['100px', ''],
            content: url
        });
    }

    function Del_banner(did)
    {
        var url = "/admin/inner/del_banner/" + did;
        layer.confirm("确定删除", function () {
            $.post(url, null, function (data) {
                var jsonData = $.parseJSON(data);
                if (jsonData.Statu == 'ok') {
                    Success(jsonData)
                }
                else {
                    Success(jsonData)
                }
            })
        }, function () {
            layer.msg('取消删除', { icon: 0 });
        })
    }
</script>
<div id="dcMain">
    <!-- 当前位置 -->
    <div id="urHere">
        DouPHP 管理中心
        <b>></b>
        <strong>内页banner</strong>
    </div>
    <div id="manager" class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
        <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
            <tr>
                <th width="30" align="center">编号</th>
                <th align="left">栏目名称</th>
                <th align="center">banner缩略图</th>
                <th align="center">操作</th>
            </tr>
            <?php foreach($top_menulist as $menu_top_item):?>
            <tr>
                <td align="center"><?php echo $menu_top_item->menuid;?></td>
                <td><?php echo $menu_top_item->title;?></td>
                <td align="center"><img src="<?php echo $menu_top_item->icon;?>" style="height:40px;width:35px;" /></td>
                <td align="center">
                    <a href="javascript:edit_banner('<?php echo site_url('admin/inner/edit_banner/'.$menu_top_item->menuid)?>')">上传</a>|
                    <a href="javascript:Del_banner(<?php echo $menu_top_item->menuid?>)">删除</a>
                </td>
            </tr>
            <?php endforeach; ?>
        </table>
        <div class='page'>
        </div>
    </div>
</div>